package com.blueocean_health.care.management.controller.app;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.blueocean_health.care.management.domain.base.SysResult;
import com.blueocean_health.care.management.domain.dto.HospitalDto;
import com.blueocean_health.care.management.domain.dto.StaticNurseDto;
import com.blueocean_health.care.management.domain.dto.StaticResourcesDto;
import com.blueocean_health.care.management.em.AppStaticResourceEnum;
import com.blueocean_health.care.management.service.HospitalService;
import com.blueocean_health.care.management.service.StaticResourceService;
import com.github.pagehelper.PageInfo;
/**
 * 静态资源图片url
 * @author wuyanli
 *
 */
@RestController
@RequestMapping(value="app/static")
public class StaticReourceController {
	
	@Resource
	private StaticResourceService staticService;
	
	@Resource
	private HospitalService hospService;

	
	/**
	 * 选择医院 列表   2018年3月14日14:44:40
	 * @return
	 */
	@RequestMapping("/hospital")
    public SysResult selectHospital(@RequestBody Map<String,String> map){
		PageInfo<HospitalDto> hospitalList = hospService.getHospitalList(map);
		Map<String,Object> resultMap = new HashMap<>();
		Map<String,Object> pageMap = new HashMap<>();
		resultMap.put("list", hospitalList.getList());
		pageMap.put("total", hospitalList.getTotal());
		resultMap.put("pageInfo", pageMap);
		 
		return SysResult.ok(resultMap);
    }
//	/**
//	 * 选择医院 列表   2018年3月14日14:44:40
//	 * @return
//	 */
//	@RequestMapping("/hospitalphone")
//    public SysResult selectHospitalPhone(@RequestBody Map<String,String> map){
//		PageInfo<HospitalDto> hospitalList = hospService.getHospitalPhone(map);
//		Map<String,Object> resultMap = new HashMap<>();
//		Map<String,Object> pageMap = new HashMap<>();
//		resultMap.put("list", hospitalList.getList());
//		pageMap.put("total", hospitalList.getTotal());
//		resultMap.put("pageInfo", pageMap);
//		 
//		return SysResult.ok(resultMap);
//    }
	/**
	 * 首页营销位
	 * @return
	 */
	@RequestMapping("/home/market")
    public SysResult getHomeMarket(@RequestBody Map<String,String> map){
		 map.put("staticStatus", AppStaticResourceEnum._1.getKey());
	     List<StaticResourcesDto> staticResources = staticService.getStaticResources(map);
	 	 return SysResult.ok(staticResources);
    }
	/**
	 * 预约成功页面营销位 2018年3月21日11:10:28
	 * @return
	 */
	@RequestMapping("/reservation/market")
	public SysResult getReservationMarket(@RequestBody Map<String,String> map){
		map.put("staticStatus", AppStaticResourceEnum._5.getKey());
		List<StaticResourcesDto> staticResources = staticService.getStaticResources(map);
		return SysResult.ok(staticResources);
	}
	/**
	 * 轮播图
	 * @return
	 */
	@RequestMapping("/roll")
	public SysResult getStaticResourceRoll(@RequestBody Map<String,String> map){
		map.put("staticStatus", AppStaticResourceEnum._2.getKey());
		List<StaticResourcesDto> staticResources = staticService.getStaticResources(map);
		return SysResult.ok(staticResources);
	}
	/**
	 * 金牌护工  2018年3月12日14:15:01
	 * @return
	 */
	@RequestMapping("/nurse")
	public SysResult getStaticResourceNurse(@RequestBody Map<String,String> map){
		
		List<StaticNurseDto> staticNurse = staticService.getStaticNurse(map);
		return SysResult.ok(staticNurse);
	}
	
	/**
	 * 客服电话  2018年3月12日14:15:01
	 * @return
	 */
	@RequestMapping("/kfphone")
	public SysResult getkfphone(){
		Map<String, String> map = new HashMap<>();
		map.put("phone", staticService.getkfphone());
		return SysResult.ok(map);
	}

}
